<?php
$servarname = "127.0.0.1";
$username = "root";
$password = "";
$dbname = "stu_result";
//创建连接
$conn = new mysqli($servarname,$username,$password,$dbname);
//$conn = new (3)($servername,$username,$password,$dbname);
//设置字符集
@mysqli_set_charset($conn,utf8);//@(4)($conn,utf8);
//检测连接
//获取连接错误信息
if($conn ->connect_error){//if($conn->(5)){
	die("连接失败:" . $conn ->connect_error);//die("连接失败："。（5)）；
}